#include <clutter/x11/clutter-x11.h>
#include <gdk/gdkx.h>
#include <gio/gio.h>
-#include <gjs/gjs-module.h>
#include <girepository.h>
#include <meta/display.h>
#include <meta/util.h>
global->last_gc_end_time = g_get_monotonic_time ();
}
-/**
- * shell_global_get_memory_info:
- * @global:
- * @meminfo: (out caller-allocates): Output location for memory information
- *
- * Load process-global data about memory usage.
- */
-void
-shell_global_get_memory_info (ShellGlobal *global,
- ShellMemoryInfo *meminfo)
-{
- JSContext *context;
- gint64 now;
-
-#ifdef HAVE_MALLINFO
- {
- struct mallinfo info = mallinfo ();
- meminfo->glibc_uordblks = info.uordblks;
- }
-#else
- meminfo->glibc_uordblks = 0;
-#endif
-
- context = gjs_context_get_native_context (global->js_context);
-
- meminfo->js_bytes = JS_GetGCParameter (JS_GetRuntime (context), JSGC_BYTES);
-
- meminfo->gjs_boxed = (unsigned int) gjs_counter_boxed.value;
- meminfo->gjs_gobject = (unsigned int) gjs_counter_object.value;
- meminfo->gjs_function = (unsigned int) gjs_counter_function.value;
- meminfo->gjs_closure = (unsigned int) gjs_counter_closure.value;
-
- now = g_get_monotonic_time ();
-
- meminfo->last_gc_seconds_ago = (now - global->last_gc_end_time) / G_TIME_SPAN_SECOND;
-}
-
-
/**
* shell_global_notify_error:
* @global: a #ShellGlobal
guint last_gc_seconds_ago;
} ShellMemoryInfo;
-void shell_global_get_memory_info (ShellGlobal *global,
- ShellMemoryInfo *meminfo);
-
-
/* Run-at-leisure API */
void shell_global_begin_work (ShellGlobal *global);
void shell_global_end_work (ShellGlobal *global);